<extend name="Base/common"/>
<block name="body">
<script>
	function changeImg(){
	   document.getElementById("img1").src = "{:U('User/verify','','')}/id/"+new Date();
	}
</script>
	<style>
		.filter-bg{

		}
	</style>
<!--<div class="container">
<div class="nav">
    <img src="__IMG__/img_1.png" alt="" id="show">
    <h3>余额提现</h3>
</div>
<div class="bank-bindbox">
<div class="bank-bindtop">
	<img src="__IMG__/icon11.png" class="bank-binding" /> &nbsp;提现
</div>
<ul class="bank-indexul">
	<li>
		<div class="bank-indexleft">姓名</div>
		<div class="bank-indexright" style="color: #cc2a1e;">{$list.bank_realname}</div>
	</li>
	<li>
		<div class="bank-indexleft">银行账户</div>
		<input type="hidden" id="bank_id" name="bank_id" value="{$list.id}" />
		<div class="bank-indexright" style="color: #cc2a1e;">{$list.bank_name}({$list.bank_card})</div>
	</li>
	<li>
		<div class="bank-indexleft">账户余额</div>
		<div class="bank-indexright"><span id="balance_money">{$money}</span>元</div>
	</li>
	<li>
		<div class="bank-indexleft">提现金额</div>
		<div class="bank-indexright"><input type="text" name="drawing_money" id="drawing_money" value="" placeholder="每笔出金最小100，最大5000" class="bank-indexinput"/></div>
	</li>
	<li>
		<div class="bank-indexleft">交易密码</div>
		<div class="bank-indexright"><input type="password" name="password" id="password" value="" class="bank-indexinput" placeholder="请输入交易密码"/></div>
	</li>

</ul>
<div style = "color:red;margin-top:10px;margin-bottom:20px;">( 注：手续费按提现金额的1%收取，单笔手续费最少2元)</div>
<p class="bank-bindtips clearfix">
		<a class="bank-bindok bank-bindti"  href="javascript:subform()">确认</a>
		<a class="bank-bindno bank-bindti" id="unbinding">解绑</a>
</p>
</div>
<div class="bank-indexUnbundling"></div>
<div class="bank-indexUnbundling2">
	<p class="bank-indexUn">确认解绑</p>
	<p class="bank-indexUn" style="color: #7e7d7d;font-weight: normal;font-size: 12px;">解绑定需要管理员确认，请在微信界面与客服联系。</p>
	<p class="bank-indexUn2">
		<a id="unbindingtwo" style="color: #ce3427;">取消</a>
		<!-- <a>确定</a>
	</p>
</div>
</div>-->
<div class="proDelBox">
	<div class="proDelPayLi proDelPayLi-css3 proDelBorderBottm">
		<p class="proDelBorderBottm proDelBorderBottm-css3">
			<span class="al">开户姓名</span>
			<span class="ax">{$list.bank_realname}</span>
		</p>
		<p  class="proDelPayLiP-css3">
			<span class="al" >选择账号</span>
			<input type="hidden" id="bank_id" name="bank_id" value="{$list.id}" />
			<span class="ax">{$list.bank_name}({$list.bank_card})</span>
		</p>
	</div>
	<div class="proDelPayLi proDelPayLi-css3 proDelBorderBottm" style="margin-top: 20px;">
		<p class="proDelPayLiP-css3">
			<span class="al" style="flex:3.5;">提现金额</span>
			<input class="ax defaultred" id="drawing_money" type="text" placeholder="账户余额{$money}"/>
			<span class="aj">元</span>
		</p>
	</div>
	<div class="proDelPayLi proDelPayLi-css3 proDelBorderBottm" style="margin-top: 20px;">
		<p class="proDelPayLiP-css3">
			<span class="al" style="flex:3.05">提款密码</span>
			<input class="ax defaultred" type="password" id="password" placeholder="请输入密码"/>

		</p>
	</div>
<p style="padding:0px 20px;margin: 20px auto;color:#989898;font-weight:normal;font-family:'microsoft yahei'" class="defaultAsh"><span class="icon-uniE90A defaultBlue"></span>手续费按提现金额的1%收取,单笔最少2元。每笔出金最小100,最大5000。</p>
<p style="padding:0px 20px;line-height: 36px;height: 36px;"><a href="javascript:void(0);" onclick="subform();" class="proDelSubmit">立即提交</a></p>
<p style="padding:0px 20px;line-height: 36px;height: 36px;"><span href="" class="proDelDfel" id="unbinding">解除绑定</span></p>
</div>
<div class="bank-indexUnbundling"></div>
<div class="bank-indexUnbundling2">
	<p class="bank-indexUn">确认解绑</p>
	<p class="bank-indexUn" style="color: #7e7d7d;font-weight: normal;font-size: 12px;">解绑定需要管理员确认，请在微信界面与客服联系。</p>
	<p class="bank-indexUn2">
		<a id="unbindingtwo" style="color: #ce3427;">取消</a>
		<a id="notbingding">确定</a>
	</p>
</div>
<script type="text/javascript">
$('#unbinding').click(function(){
	$('.bank-indexUnbundling').toggle();
	$('.bank-indexUnbundling2').toggle();
})
$('.bank-indexUnbundling').click(function(){
	$('.bank-indexUnbundling').toggle();
	$('.bank-indexUnbundling2').toggle();
})
$('#unbindingtwo,#notbingding').click(function(){
	$('.bank-indexUnbundling').toggle();
	$('.bank-indexUnbundling2').toggle();
})
function subform(){
	var bank_id=$('#bank_id').val();		//银行账户
	var balance_money=$('#drawing_money').attr('placeholder');	//账户余额
	var drawing_money=$('#drawing_money').val();		//提现金额
	var password=$('#password').val();		//交易密码
	var code=$('#code').val();				//验证码
	var reg=/^\d+(\.\d+)?$/g;
   if(drawing_money=='' || 1*drawing_money<100 || 1*drawing_money>5000 || !reg.test(drawing_money)){
      alert('提现金额不正确',2000);
      return false;
   }
   if(password==""){
       alert('请输入正确的提款密码',2000);
       return false;
   }
   $.post("{:U('User/draw_money')}",
   		{
   			bank_id:bank_id,
   			balance_money:balance_money,
   			drawing_money:drawing_money,
   			password:password,code:code
   		},function(data){
   			alert(data.msg,2000);
   			if(data.status){
   				setTimeout(link_url(),1000);
   			}
  },"json")
}
function link_url(){
	var url_href="{:U('Payments/payments')}";
	window.location.href=url_href;
}
</script>
<include file="Public/footer"/>
</block>
